if (C_UTIL===undefined) {
	var C_UTIL={};
}

C_UTIL.extend = function(subClass, baseClass) {
   function inheritance() {}
   inheritance.prototype = baseClass.prototype;

   subClass.prototype = new inheritance();
   subClass.prototype.constructor = subClass;
   subClass.baseConstructor = baseClass;
   subClass.superClass = baseClass.prototype;
}

C_UTIL.addGoogleMapUrl = function(keys,key) {
	var defaultKeys = [
		{url:'http://localhost/',key:'ABQIAAAAbUMOSkHMwxHkspqFTPskURT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRtwS0ikAFTq5JplqGuyzYptC6iCA'},
		{url:'http://localhost/googlemap/',key:'ABQIAAAAbUMOSkHMwxHkspqFTPskURTcyTBaKMmwi780-Sh78Ay3Pg36mBR7VLvownK5Hnuq90wpnamIWR7vMA'},
		{url:'http://localhost/gdsn_ajax_hack/',key:'ABQIAAAAbUMOSkHMwxHkspqFTPskURQU2V9PZ3gGa5mieOOlr7mQqqhT_hQv4LOD5FUw-PMviYBit7DpLumvug'},
		{url:'http://156.80.108.216:8080/bluebox/',key:'ABQIAAAAbUMOSkHMwxHkspqFTPskURQJu-s4DkJO60zaANysU6xXPn9KYhSOFurAqK8EIh25zBIRHCf6N6vk9Q'},
		{url:'http://christopherlyth.com/googlemap/',key:'ABQIAAAAbUMOSkHMwxHkspqFTPskURRT9f1Or5XjwJ3oOBVM9CPHUwxrfxQUuZP8tZ0N-q2cQ04hRo8ID8NFWg'}];

	var checkKeys = function(keys) {
		var match = {ammt:-1};
		var c;
		for (var i=0;i<keys.length;i++) {
			c=window.location.href.indexOf(keys[i].url);
			if (c>-1) {
				if (match.ammt<keys[i].url.length) {
					match.ammt = keys[i].url.length;
					match.key = keys[i].key;
				}
			}
		}
		return match.key;
	}
	var url = 'http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=';
	var googleKey;
	if (key) {
		googleKey = key;
	} else if (keys){
		googleKey = checkKeys(keys);
	} else if (defaultKeys) {
		googleKey = checkKeys(defaultKeys);
	}
	if (googleKey){
		var tag = "<script src='"+url+googleKey+"'></script>";
		document.write(tag);
	}		
}